Skip to content

Allow full-reload HMR events with a path#1155

Open
flacoshinobi wants to merge 1 commit intocrxjs:mainfrom
flacoshinobi:fix/vite7-full-reload-hmr-event
Open

Allow full-reload HMR events with a path#1155
flacoshinobi wants to merge 1 commit intocrxjs:mainfrom
flacoshinobi:fix/vite7-full-reload-hmr-event

Conversation

@flacoshinobi
Copy link
Copy Markdown

Removes the filter that blocked 'full-reload' events when a path was specfied. This ensures all full-reload signals are forwarded to the content scripts, improving compatibility with Vite 7+ and fixing cases where reloads were missed

Removes the filter that blocked 'full-reload' events when a path was specfied. This ensures all full-reload signals are forwarded to the content scripts, improving compatibility with Vite 7 and fixing cases where reloads were missed
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 17, 2026

⚠️ No Changeset found

Latest commit: d9be461

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Toumash
Copy link
Copy Markdown
Member

Toumash commented Apr 19, 2026

hmm how about only implementing it only for vite7 then? I forgot what does it do and i remember fighting that filter in one of the e2e tests

@flacoshinobi
Copy link
Copy Markdown
Author

This update is also important for compatibility with Vite 8.
I found that starting from version 7.1.0-beta.0, Vite now uses * as the default value for the path during a full-reload.
As a result, the undefined value that the current logic expects is no longer passed in newer versions, which is why full-reload has stopped working in content scripts

You can see the specific change in the Vite source code here:
https://github.com/vitejs/vite/blob/v7.1.0-beta.0/packages/vite/src/node/server/hmr.ts#L712-L717

If there are reasons not to allow all paths, we should at least check for both * and undefined to ensure backward compatibility with older Vite versions while supporting Vite 7.1+ and Vite 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants